<?php if (!defined('THINK_PATH')) exit();?><div class="bjui-pageHeader">
    <div class="pull-right">
        <!-- <button class="btn-default" data-icon="plus" title="添加订单" data-toggle="tooltip" data-placement="left" onclick="createDialog('<?php echo U("Forms/order");?>', '添加订单', 'order', {width:800, height:500} )"></button> -->
        <a type="button" class="btn btn-default" href="<?php echo U('Index/save');?>" data-toggle="doexportchecked" data-group="ids" data-confirm-msg="确定要导出选中项吗？" data-icon="cloud-download"></a>
        <button class="btn-default" data-icon="refresh" onclick="$.CurrentNavtab.navtab('refresh')"></button>
    </div>
    <form id="pagerForm" data-toggle="ajaxsearch" data-loadingmask="true" action="<?php echo U('index');?>" method="post">
        <input type="hidden" name="pageSize" value="<?php echo I('param.pageSize');?>" />
        <input type="hidden" name="pageCurrent" value="<?php echo I('param.pageCurrent');?>" />
        <input type="hidden" name="orderField" value="<?php echo I('param.orderField');?>" />
        <input type="hidden" name="orderDirection" value="<?php echo I('param.orderDirection');?>" />
        <div class="bjui-searchBar">
            <label>收货人:</label>
            <input type="text" name="name" value="<?php echo I('name');?>"class="w100" />
            <label>订单号:</label>
            <input type="text" name="order_no" value="<?php echo I('order_no');?>" />
            <label>区间:</label>
            <input type="text" name="start_time" value="<?php echo I('start_time');?>" class="dateStart"  data-toggle="datepicker" style="width: 150px;" />
            -
            <input type="text" name="end_time" value="<?php echo I('end_time');?>" class="dateEnd" data-toggle="datepicker"  style="width: 150px;" />
            <button type="button" class="showMoreSearch" data-toggle="moresearch" data-name="custom"><i class="fa fa-angle-double-down"></i></button>
            <button type="submit" class="btn-default" data-icon="search">查询</button>
            <a class="btn btn-orange" href="javascript:;" data-toggle="reloadsearch" data-clear-query="true" data-icon="undo">清空查询 </a>
        </div>
        <div class="bjui-moreSearch">
            <select name="order_status" data-toggle="selectpicker">
            <option value="">订单状态</option>
            <option value="0" <?php if(I('order_status') == '0'): ?>selected<?php endif; ?>>未付款</option>
            <option value="1" <?php if(I('order_status') == '1'): ?>selected<?php endif; ?>>已付款 待发货</option>
            <option value="2" <?php if(I('order_status') == '2'): ?>selected<?php endif; ?>>部分发货</option>
            <option value="3" <?php if(I('order_status') == '3'): ?>selected<?php endif; ?>>已发货</option>
            <option value="4" <?php if(I('order_status') == '4'): ?>selected<?php endif; ?>>已完成 待评价</option>
            <option value="5" <?php if(I('order_status') == '5'): ?>selected<?php endif; ?>>退款审核中</option>
            <option value="6" <?php if(I('order_status') == '6'): ?>selected<?php endif; ?>>已成功退款</option>
            <option value="8" <?php if(I('order_status') == '8'): ?>selected<?php endif; ?>>已评价</option>
            </select>
            <select name="pay_type" data-toggle="selectpicker">
            <option value="">支付方式</option>
            <option value="0" <?php if(I('pay_type') == '0'): ?>selected<?php endif; ?>>货到付款</option>
            <option value="1" <?php if(I('pay_type') == '1'): ?>selected<?php endif; ?>>微信支付</option>
            <option value="2" <?php if(I('pay_type') == '2'): ?>selected<?php endif; ?>>支付宝支付</option>
            <option value="3" <?php if(I('pay_type') == '3'): ?>selected<?php endif; ?>>银联支付</option>
            <option value="4" <?php if(I('pay_type') == '4'): ?>selected<?php endif; ?>>财付通支付</option>
            </select>
        </div>
    </form>
</div>
<div class="bjui-pageContent tableContent">
    <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="false">
        <thead>
        <!--
            data-order-field="数据库名字"  排序
        -->
        <tr>
            <th width="26"><input type="checkbox" class="checkboxCtrl" data-group="ids" data-toggle="icheck"></th>
            <th>订单号</th>
            <th>下单会员</th>
            <th>商品总金额</th>
            <th>实付金额</th>
            <th data-order-field="ostatus">订单状态</th>
           <!--  <th data-order-field="zstatus">支付状态</th>
            <th data-order-field="fstatus">发货状态</th> -->
            <th data-order-field="typestatus">支付方式</th>
            <th data-order-field="ordertime">下单时间</th>
            <th width="100">操作</th>
        </tr>
        </thead>
        <tbody>
        <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
            <th width="26"><input type="checkbox" value="1" class="checkboxCtrl" name="ids" data-toggle="icheck"></th>
            <td><?php echo ($vo["order_no"]); ?></td>
            <td><?php echo ($vo["user_mobile"]); ?></td>
            <td><?php echo ($vo["payable_amount"]); ?></td>
            <td><?php echo ($vo["order_amount"]); ?></td>
            <td><?php echo order_status($vo['order_status']);?></td>
           <!--  <td>已支付</td>
            <td>未发货</td> -->
            <td><?php echo order_pay_status($vo['pay_type']);?></td>
            <td><?php echo ($vo["create_time"]); ?></td>
            <td>
                <button type="button" class="btn-blue" onclick="createDialog('<?php echo U("Order/msg",array("id"=>$vo["id"]));?>', '订单详细', 'ordermsg', {width:800, height:500})">详</button>
                <?php if($vo["order_status"] == '0'): ?><a href="<?php echo U('Order/del_order',array('id'=>$vo['id']));?>" class="btn btn-red" data-type="get" data-toggle="doajax" data-confirm-msg="你确定要删除该订单吗？" >删</a><?php endif; ?>
            </td>
        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
        </tbody>
    </table>
</div>

<div class="bjui-pageFooter">
		
	<?php if(page == save): ?><ul>
			<li><button type="submit" class="btn-default" data-icon="save">保存</button></li>
	        <li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
	    </ul>
	<?php elseif(page == close): ?>
	    <ul>
	        <li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
	    </ul>
	<?php elseif(page == page and $show != null): ?>
		<ul>
	        <li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
	    </ul>
		    <div class="pages">
		        <span>每页&nbsp;</span>
		        <div class="selectPagesize">
		            <select data-toggle="selectpicker" data-toggle-change="changepagesize">
		                <option value="<?php echo ($show['listrow']); ?>"><?php echo ($show['listrow']); ?></option>
		                <option value="60">60</option>
		                <option value="120">120</option>
		                <option value="150">150</option>
		            </select>
		        </div>
		        <span>&nbsp;条，共 <?php echo ($show['total']); ?> 条</span>
		    </div>
		    <div class="pagination-box" data-toggle="pagination" data-total="<?php echo ($show['total']); ?>" data-page-size="<?php echo ($show['listrow']); ?>" data-page-current="1">
		    </div>
	<?php elseif(page == page and $show == null): ?>
		<ul>
			<li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
		</ul>
	<?php else: ?>
		<ul>
			<li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
		</ul><?php endif; ?>

</div>